Method of accessing virtual storage device through virtual data router

ABSTRACT

A method of accessing a virtual storage device through a virtual data router (VD router) is described. A virtual disk device on a controller may be accessed from various controllers through different paths based on asynchrony of data sending/receiving of a VD router. Moreover, the method is advantageous in having high access efficiency and consistency of data access via different paths at the same time.

BACKGROUND OF THE INVENTION

1. Field of Invention

The present invention relates to a method of accessing a virtual storagedevice, and more particularly to a method of accessing a virtual storagedevice through a virtual data (VD) router.

2. Related Art

Currently, multi-path input output (MPIO) technology is widely utilizedin a dual controller environment, for performing data storage andread/write operations on a network storage device. Through the MPIOtechnology, a network storage device is accessed via one or morephysical links, and network storage applications become more adaptablewith better performances by means of I/O scheduling strategies of faulttolerant, traffic load balance, and fine granularity.

The MPIO technology requires to make mapping backups of disk accesspaths, and to access a disk via any path. Therefore, when a path goesabnormal, another path may be used to access the storage device, thuspreventing the services and connections from interruption.

When a disk is accessed, an established virtual logical volume manager(LVM) device may only be stored in a controller and can be directlyaccessed, but the question is how to access the same virtual device fromanother controller.

Currently, in the conventional art, a net bridge block device (NBD) isprovided by the Linux system for performing the mapping of a remotedevice, i.e., to access a virtual device on another controller vianetwork paths mapped between virtual block devices provided by the NBD.However, the NBD may cause many problems in use, and the major ones arelisted below. (1) As a remote disk device is accessed completely bymeans of serialization, i.e., the next I/O operation will not be carriedout until the previous I/O operation of the remote disk device isfinished, the access through NBD is low in efficiency. (2) As the NBDhas a system cache, the data obtained from the NBD is inconsistent withthat obtained from a physical device at the same time, i.e., thephenomenon that the data read from the NBD (where a virtual mirror imagedevice is established) is inconsistent with that read from a physicaldevice at the same time may occur.

SUMMARY OF THE INVENTION

To solve the problems and defects in the conventional art, the presentinvention is directed to a method of accessing a virtual storage devicethrough a VD router. A virtual disk device on a controller may beaccessed from various controllers through different paths based onasynchrony of data sending/receiving of a VD router.

The present invention provides a method of accessing a virtual storagedevice through a VD router. According to the method, a VD router isrespectively disposed in each controller in a network storageenvironment with multiple controllers, so as to access a virtual diskdevice on a controller from different controllers. The method includesthe following steps.

When a data read/write operation is to be performed on a virtual diskdevice, a data read/write request is packaged and then sent to a VDrouter of a local controller. The VD router determines whether thevirtual disk device is located on the local controller according to apre-stored mapping relationship between a logical unit number (LUN) andan actual logical volume (LV). If the virtual disk device is located onthe local controller, a data read/write operation of a local device isperformed on the virtual disk device, and the operation result is fedback to the VD router. If the virtual disk device is not located on thelocal controller, data to be read/written is packaged into a format of aVD router task, and the data read/write task is temporarily stored in atask queue and then sent to the remote controller where the virtual diskdevice is located. Then, the remote controller performs a dataread/write operation on the virtual disk device, and feeds back theoperation result to the local controller after the data read/writeoperation is finished. Thereby, the local controller queries, obtains,and then ends the corresponding data read/write task in the task queueaccording to relative information contained in the operation result, andsubsequently feeds back the operation result of the data read/write taskto the VD router.

In view of the above, the present invention has the followingadvantages.

A method of accessing a virtual storage device through a VD router isprovided, such that a virtual disk device on a controller may beaccessed from various controllers through different paths based onasynchrony of data sending/receiving of a VD router. As the mappingmechanism adopted by the method of the present invention is not adevice-to-device mapping in the conventional art, but only a mapping oflogic relationship of an LUN, a remote access request in accordance witha device is first packaged and sent to the device. Then, a read/writeoperation is performed on the device, and data sending and receiving areseparated into different processes. That is, the sending of a dataread/write request and the receiving of the result of the dataread/write operation are performed separately, which is a completelyasynchronous process. Thereby, the problem that data sending is blockedby data receiving due to the adoption of serialization to access aremote disk device in the conventional art is avoided, and it isunnecessary to wait for a long time before a slow I/O operation isfinished. Meanwhile, the operation instruction may be properly optimizedfrom a remote end, so as to reasonably integrate a series of small dataI/O packets into a large data I/O packet to be sent out. In this manner,frequent network data transmission operations are reduced, and theutilization of network resources is effectively improved, therebyensuring an unblocked simultaneous access of data read/write of anapplication program, and greatly enhancing the access efficiency.Further, in the method of the present invention, actual read and writeoperations to the virtual disk device both occur at the device, and thedevice only has one system cache, so it is easy to achieve and ensurethe consistency of data access via different paths at the same time. Inaddition, as the VD router employed by the method of the presentinvention only has one operation process, the consumption of systemresources required by frequent process switching in the conventional artcan be reduced.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention will become more fully understood from thedetailed description given herein below for illustration only, and thusare not limitative of the present invention, and wherein:

FIG. 1 is a systematic block diagram of a system run by a method ofaccessing a virtual storage device through a VD router according to anembodiment of the present invention; and

FIG. 2 is a flow chart of a method of accessing a virtual storage devicethrough a VD router according to the present invention.

DETAILED DESCRIPTION OF THE INVENTION

Preferred embodiments of the present invention will be illustrated indetail below with the accompanying drawings.

Referring to FIG. 1, a systematic block diagram of a system run by amethod of accessing a virtual storage device through a VD routeraccording to an embodiment of the present invention is shown. In FIG. 1,according to the system embodiment run by the method of the presentinvention, a VD router 30 is disposed in each controller in a dualcontroller network storage environment having a first controller 10 anda second controller 20, so as to access a virtual disk device on acontroller from different controllers. In addition, it should be notedthat the VD router is an indispensable part in the path backuptechnology for realizing MPIO, so as to access a virtual disk device ona controller from different storage controllers at the same time.

In the dual controller environment of FIG. 1, a VD router-server module40 and a VD router-client module 50 are respectively disposed in thefirst controller 10 and the second controller 20. The VD router-servermodule 40 is used to realize a VD router-server process at the physicaldevice. The main task of the process is to receive data sent from theremote VD router-client module 50 and respond the result of the dataread/write operation to the remote VD router-client module 50. The VDrouter-server module 40 is mainly used for sending data.

When a data read/write operation is to be performed on a virtual diskdevice, a data read/write request is packaged and then sent by an upperlayer to the VD router 30 of the first controller 10, the VD router 30determines whether the virtual disk device is located on the local firstcontroller 10 according to a pre-stored mapping relationship between anLUN and an actual LV.

If the virtual disk device is located on the local first controller 10,data is sent from the local VD router-client module 50 to an LV 60, suchthat a data read/write operation of a local device is performed on thevirtual disk device, and the operation result is fed back to the VDrouter 30 and then reported to the upper layer.

If the virtual disk device is not located on the first local controller10 but on the remote second controller 20, data to be read/written ispackaged into the format of a VD router task, and the data read/writetask is temporarily stored in a task queue. After that, the data is sentfrom the local VD router-client module 50 on the first controller 10 tothe VD router-server module 40 on the remote second controller 20 wherethe virtual disk device is located. Then, the VD router-server module 40sends the data to the LV 60, such that a data read/write operation isperformed on the virtual disk device, and the VD router-server module 40feeds back the operation result (success or failure) to the VDrouter-client module 50 on the first controller 10 after the dataread/write operation is finished. Thereby, the VD router-client module50 queries, obtains, and then ends the corresponding data read/writetask in the task queue according to relative information contained inthe operation result, and subsequently feeds back the operation resultof the data read/write task to the VD router 30 and further reports tothe upper layer.

In addition, the system run by a method of the present invention is notlimited to the dual controller system architecture in FIG. 1, but may bea system architecture with more controllers. A system architecture withmore controllers has no substantial difference from the dual controllersystem architecture in configuration, but each controller needs to storea copy of device mapping table and perform a VD router-server process,for handling multiple VD router requests. When a VD router request isgenerated, each controller determines the controller where the device islocated according to the device mapping table, and then sends therequest to the corresponding controller. When an operation result is tobe fed back, each controller determines which one the operation resultis to be fed back to according to relative information contained in therequest about the controller that sends the request.

Now referring to FIG. 2, a flow chart of a method of accessing a virtualstorage device through a VD router according to the present invention isshown. In FIG. 2, according to the method of the present invention, a VDrouter is disposed in each controller in a network storage environmenthaving multiple (two or more) controllers, so as to achieve the purposeof accessing a virtual disk device on a controller from differentcontrollers. The method includes the following steps.

First, when a data read/write operation is to be performed on a virtualdisk device, a data read/write request is packaged and then sent to a VDrouter of a local controller (Step 100).

Next, the VD router determines whether the virtual disk device islocated on the local controller according to a pre-stored mappingrelationship between an LUN and an actual LV (Step 200).

If the virtual disk device is located on the local controller, a dataread/write operation of a local device is performed on the virtual diskdevice (Step 300), and the operation result is fed back to the VD routerand then reported to an upper layer (Step 400).

On the contrary, if the virtual disk device is not located on the localcontroller, data to be read/written is packaged into the format of a VDrouter task, and the data read/write task is temporarily stored in atask queue (Step 500). Then, the data is sent to a remote controllerwhere the VD virtual disk device is located (Step 600), and a dataread/write operation is performed by the remote controller on thevirtual disk device (Step 700). After the data read/write operation isfinished, the remote controller feeds back the operation result to thelocal controller (Step 800). Thereby, the local controller queries,obtains, and then ends the corresponding data read/write task in thetask queue according to relative information contained in the operationresult (Step 900), and subsequently feeds back the operation result ofthe data read/write task to the VD router and further reports to theupper layer (Step 400).

1. A method of accessing a virtual storage device through a virtual datarouter (VD router), wherein a VD router is disposed in each controllerin a network storage environment having multiple controllers, so as toaccess a virtual disk device on a controller from different controllers,the method comprising: when a data read/write operation is to beperformed on a virtual disk device, sending a data read/write request toa VD router of a local controller; the VD router determining whether thevirtual disk device is located on the local controller according to apre-stored mapping relationship between a logical unit number (LUN) andan actual logical volume (LV); if the virtual disk device is located onthe local controller, performing a data read/write operation of a localdevice on the virtual disk device, and feeding back an operation resultto the VD router; and if the virtual disk device is not located on thelocal controller, packaging data to be read/written into a format of aVD router task, and temporarily storing the data read/write task in atask queue, then sending the data to a remote controller where thevirtual disk device is located, and performing a data read/writeoperation by the remote controller on the virtual disk device, whereinafter the data read/write operation is finished, the remote controllerfeeds back the operation result to the local controller, such that thelocal controller queries and obtains the corresponding data read/writetask in the task queue according to relative information contained inthe operation result, and subsequently feeds back the operation resultof the data read/write task to the VD router.
 2. The method of accessinga virtual storage device through a VD router as claimed in claim 1,before sending a data read/write request to a VD router of a localcontroller, further comprising packaging the data read/write request. 3.The method of accessing a virtual storage device through a VD router asclaimed in claim 1, after querying and obtaining the corresponding dataread/write task from the task queue, further comprising ending the dataread/write task.
 4. The method of accessing a virtual storage devicethrough a VD router as claimed in claim 1, wherein the number of themultiple controllers is two or more.